function renderSingles(){
	$(".single").each(function( index, element ) {
		$(element).removeClass("hidden-email");
		if(index>4 && !($(element).hasClass("not-email"))){
			
			$(element).addClass("hidden-email");
			$(element).hide();
		}else{
			$(element).removeClass("hidden-email");
			$(element).css("display","inline-block");
		}
	});

	var singleCount = $(".single").length-1;
	if(singleCount>5){
		$(".single.not-email b").html(singleCount-6+1);
		$(".single.not-email").show();
	}else{
		$(".single.not-email").hide();
	}
};

$( document ).ready(function() {
	renderSingles();

	
	
});


$( ".single .remove" ).click(function() {
	$(this).parent().fadeOut().remove();
	renderSingles();
});

$( ".send-button" ).click(function() {
	$(".form-wrapper").hide();
	$('#confirmModal').modal('hide');
	$(".confirmation").fadeIn();
});

$(".single.not-email").click(function() {
	$(".single.not-email").hide();
	$(".single.hidden-email").fadeIn().css("display","inline-block");

});